<?php $this->load->view('tourism/layout/header')?>
    <div class="wares-text widthMax tourism-infor">
        <div class="wares-head clearfix">
            <a href="javascript:goHistoryBack();" class="wares-return">
                <i class="iconfont icon-zuojiantou"></i>
            </a>
            <div class="wares-mose">
                <a href="<?php echo site_url('tourism/tourismcart');?>">
                    <i class="iconfont icon-gouwuche"></i>
                </a>
                <a href="<?php echo site_url('home/ucenter/index');?>" class="share">
                    <i class="iconfont icon-wode"></i>
                </a>
            </div>
        </div>
        <div class="am-slider am-slider-default beizhu-home" data-am-slider='{}' data-am-flexslider="{playAfterPaused:500}" data-am-widget="slider">
            <ul class="am-slides">
                <?php foreach(explode(',', $info->images) as $image):?>
                    <li>
                        <img class="lazy" src="<?php echo $this->config->show_image_url($image, '640-640');?>"/>
                    </li>
                <?php endforeach;?>
            </ul>
        </div>
        <div class="wares-title">
            <div class="title-box flex">
                <h5 class="flex-1"><?php echo $info->goods_name;?></h5>
                <!--<div class="myshare  tourism-share" data-link="<?php echo current_url();?>" data-name="<?php echo isset($info->goods_name) ? $info->goods_name : '着想科技';?>" data-img="<?php echo $this->config->show_image_url($info->images);?>">
                <i class="iconfont icon-fenxiang"></i>
                <p>我要分享</p>
            </div>-->
            </div>
            <div class="wares-price flex">
                <i><span>￥</span><?php echo $info->shop_price;?></i>
                <div class="wares-dis">优惠购</div>
                <?php if($info->swim>0):?>
                    <div class="wares-dis"><?php echo $info->swim.'积分';?></div>
                <?php endif;?>

                <?php if ($info->limit_num > 0 && empty($bayNum)):?>
                    <div class="wares-dis"><?php echo '限购'.$info->limit_num.'件';?></div>
                <?php elseif ( isset($bayNum) && $bayNum >= $info->limit_num ) : ?>
                    <div class="wares-dis"><?php echo $info->limit_day.'天内，限购'.$info->limit_num.'件';?></div>
                <?php endif;?>
            </div>
            <div class="wares-cost flex">
                <s class="flex-1">原价￥<?php echo $info->market_price;?></s>
                <p>已售出<?php echo $info->sale_count;?>件</p>
            </div>
            <ul class="wares-norm">
                <li data-am-offcanvas="{target: '#doc-city'}">
                    <p>快递：<span class="transport-cost"></span></p>
                    <p class="wares-man flex-1 transport-infor" price="<?php echo $info->shop_price;?>" weight="<?php echo $info->weight;?>" transport_id="<?php echo $info->transport_id;?>" transport_cost = "<?php echo $info->transport_cost;?>"  goods_attr_id="<?php echo $info->goods_attr_id;?>"  uid="<?php echo $info->uid;?>"><span class="province"><?php $pro = get_cookie('province'); echo empty($pro) ? '浙江' : $pro;?></span></p>
                    <i class="iconfont icon-youjiantou"></i>
                </li>
                <li>
                    <a href="javascript:;" data-am-modal="{target:'#my-actions'}" class="flex">
                        <p class="flex-1">
                            规格
                        </p>
                        <i class="iconfont icon-youjiantou"></i>
                    </a>
                </li>
                <li>
                    <a <?php if($reviewTotal->countReviews>0):?>href="<?php echo site_url('tourism/goods/reviews').'?goodsAttrId='.$info->goods_attr_id;?>"<?php endif;?> class="flex">
                        <p>商品评价</p>
                        <div class="wares-com">
                            <span><?php echo ($reviewTotal->countReviews != 0) ? (bcdiv($reviewTotal->goodReviews,$reviewTotal->countReviews,2)*100).'%':'0';?></span>好评
                        </div>
                        <span class="wares-man flex-1">
                            <?php echo $reviewTotal->countReviews;?>人评价
                        </span>
                        <i class="iconfont icon-youjiantou"></i>
                    </a>
                </li>
            </ul>
        </div>
        <?php if ($shop->num_rows()>0) : ?>
            <div class="wares-vend">
                <div class="vend-head flex">
                    <img src="<?php echo $this->config->show_image_url($shop->row(0)->logo);?>"/>
                    <div class="flex-1">
                        <h5><?php echo $shop->row(0)->name;?></h5>
                        <?php $num = $this->tourism_collect_shop->collectProviderTotal($shop->row(0)->uid);?>
                        <p>已有 <?php echo $num;?>人收藏</p>
                    </div>
                </div>
                <div class="vend-bottom flex">
                    <div class="vend-box">
                        <a href="<?php echo site_url('tourism/tourismprovider/allProduct').'?providerUid='.$shop->row(0)->uid;?>">
                            全部商品
                        </a>
                    </div>
                    <div class="vend-box">
                        <a href="<?php echo site_url('tourism/tourismprovider/grid').'?providerUid='.$shop->row(0)->uid;?>">
                            进入站点
                        </a>
                    </div>
                </div>
            </div>
        <?php endif;?>
        <div class="wares-room">
            <h4>热门推荐<i class="iconfont shuaxin am-fr icon-shuaxin" uid="<?php echo $info->uid;?>" pg=0;></i></h4>
            <ul class="wares-list flex hot-recommend"></ul>
        </div>
        <div class="wares-tags am-tabs" data-am-tabs>
            <ul class="am-tabs-nav flex" data-am-sticky>
                <li class="am-active">
                    <a href="#tab1">
                        <p>商品介绍</p>
                    </a>
                </li>
                <li>
                    <a href="#tab2">
                        <p>商品参数</p>
                    </a>
                </li>
                <li>
                    <a href="#tab3">
                        <p>专享服务</p>
                    </a>
                </li>
            </ul>
            <div class="am-tabs-bd">
                <div class="am-tab-panel am-in am-active" id="tab1">
                    <?php echo empty($info->wap_goods_desc) ? '' : $info->wap_goods_desc;?>
                </div>
                <div class="am-tab-panel" id="tab2">
                    <h5>主要参数</h5>
                    <?php if ($info->goods_spec) : ?>
                        <table class="wares-table">
                            <tbody>
                            <?php foreach (unserialize($info->goods_spec) as $key => $item) : ?>
                                <tr>
                                    <td><?php echo $key; ?></td>
                                    <td>
                                        <p><?php echo $item; ?></p>
                                    </td>
                                </tr>
                            <?php endforeach;?>
                            </tbody>
                        </table>
                    <?php endif;?>
                </div>
                <div class="wares-service am-tab-panel" id="tab3">
                    <dl>
                        <dt>服务承诺：</dt>
                        <dd>
                            <h4>凡在平台购买的产品均由平台提供品质担保服务， 如发生商品质量问题、付款后未收到货等情况，公司可及时为用户提供退货退款服务，保证用户在平台的网购权益。</h4>
                            <h4>如收到货物有损坏、遗漏等情形，请及时拍照，确保货物是刚收到时的状态并未进一步使用。公司将按正常售后退换货程序介入处理，为用户提供退换货服务。</h4>
                            <p>注：因厂家会不定期更改产品包装、产地或者一些附件，部分商品会因未及时更新，出现实物与商城图片、产地、附件说明不一致，发生此类情况带来的不便，请大家谅解。</p>
                        </dd>
                    </dl>
                    <dl>
                        <dt>权利申明：</dt>
                        <dd>
                            <h4>平台上的所有商品信息、客户评价、商品咨询等内容，是平台重要的经营资源，未经许可，禁止非法转载使用。</h4>
                            <h4>对于会员利用系统漏洞、作弊等违规方式生成不公平交易订单，经查证，公司有权直接取消订单并查封会员账号，同时保留追究相应法律责任的权利。</h4>
                        </dd>
                    </dl>
                    <dl>
                        <dt>价格申明：</dt>
                        <dd class="wares-h4 flex">
                            <h4>销售价：</h4>
                            <p class="flex-1">产品页面显示的标红价格为商品的常规零售价，系统不同权限的会员账户，具体结算价以订单结算页价格为准。</p>
                        </dd>
                        <dd class="wares-h4 flex">
                            <h4>原　价：</h4>
                            <p class="flex-1">商品展示的划横线价格为参考价，该价格可能是品牌专柜标价、商品吊牌价或由品牌供应商提供的正品零售价（如厂商指导价、建议零售价等）或该商品在系统平台上曾经展示过的销售价；由于地区、时间的差异性和市场行情波动，品牌专柜标价、商品吊牌价等可能会与您购物时展示的不一致，该价格仅供您参考。</p>
                        </dd>
                        <dd class="wares-h4 flex">
                            <h4>疑　问：</h4>
                            <p class="flex-1">如有疑问，您可在购买前联系客服400-0571-648进行咨询。</p>
                        </dd>
                    </dl>
                </div>
            </div>
        </div>
    </div>
    <div class="wares-foot">
        <ul class="flex am-cf">
            <li>
                <a href="<?php echo site_url('tourism/tourismprovider/grid');?>">
                    <i class="iconfont active icon-shouye"></i>
                    <p>首页</p>
                </a>
            </li>
            <li>
                <?php if($shop->num_rows()>0):?>
                    <a href="<?php echo site_url('tourism/tourismprovider/grid'); ?>" >
                        <i class="iconfont active icon-dianpu"></i>
                        <p>进入站点</p>
                    </a>
                <?php else:?>
                    <a href="javascript:;">
                        <i class="iconfont icon-dianpu"></i>
                        <p>进入站点</p>
                    </a>
                <?php endif;?>
            </li>
            <li>
                <a <?php if($this->uid):?>
                    onclick="javascript:addShrine(<?php echo $info->goods_attr_id;?>,this, 1);"
                <?php else:?>
                    href="<?php echo site_url('login/login/index') ?>"
                <?php endif;?>
                >
                    <i class="iconfont icon-shoucang <?php if($isExist->num_rows()>0):?>active<?php endif;?>"></i>
                    <p class="collect"><?php if($isExist->num_rows()>0):?>已收藏<?php else:?>收藏<?php endif;?></p>
                </a>
            </li>
            <li>
                <a href="javascript:;" data-am-modal="{target:'#my-actions'}">
                    加入购物车
                </a>
            </li>
            <li>
                <a href="javascript:;" data-am-modal="{target:'#my-actions'}">
                    立即购买
                </a>
            </li>
        </ul>
    </div>
    <!-- 地址 -->
    <div id="doc-city" class="am-offcanvas">
        <div class="wares-city am-offcanvas-bar am-offcanvas-bar-flip">
            <div class="city-head flex">
                <a href="javascript:;" class="city-return">
                    <i class="iconfont icon-zuojiantou"></i>
                </a>
                <div class="city-alt flex-1">
                    配送至
                </div>
            </div>
            <div class="city-name">
                <ul>
                    <?php foreach($region->result() as $item):?>
                        <li <?php if(!(strcmp(get_cookie('province'),$item->region_name))):?> class="active"<?php endif;?>>
                            <p class="flex-1"><?php echo $item->region_name;?></p>
                            <i class="iconfont icon-shuruzhengque"></i>
                        </li>
                    <?php endforeach;?>
                </ul>
            </div>
        </div>
    </div>
    <div class="am-modal-actions" id="my-actions">
        <a href="javascript:;" class="wares-close" data-am-modal-close>
            <i class="iconfont icon-cha"></i>
        </a>
        <div class="wares-open">
            <div class="open-list flex">
                <img class="lazy" src="/skins/tourism/images/load.jpg" data-original="<?php echo $this->config->show_image_url($info->images, '300-300');?>"/>
                <div class="open-right flex-1">
                    <h5><?php echo $info->goods_name;?></h5>
                    <i><span>￥</span><?php echo $info->shop_price ;?></i>
                    <div class="wares-stock">
                        库存<?php echo $info->goods_num;?>件
                    </div>
                </div>
            </div>

            <?php if(!empty($categorySpec) && count($categorySpec) > 0): ?>
                <?php foreach ($categorySpec as $key=>$value): ?>
                    <div class="wares-spec flex chose-spec">
                        <h6 class="text-overflow"><?php echo $value['attr_name'];?></h6>
                        <ul class="wares-click flex-1 am-cf">
                            <?php foreach ($value['spec'] as $i=>$v):?>
                                <li <?php if($i==0):?>class="active"<?php endif;?>>
                                    <input type="radio" name="spec[<?php echo $v->attr_id?>]" value="<?php echo $v->spec_id;?>"  class="am-hide spec"  <?php if($i==0):?>checked="checked"<?php endif;?>/>
                                    <?php echo $v->attribute_value;?>
                                </li>
                            <?php endforeach;?>
                        </ul>
                    </div>
                <?php endforeach;?>
            <?php endif;?>
            <div class="wares-spec flex">
                <h6>数量</h6>
                <div class="flex-1">
                    <div class="wares-count flex coll-num">
                        <span class="minus" unselectable="on" onclick="javascript:goodsQtyUpdate('down',$(this),0)">-</span>
                        <input type="text" name="goodsNum" value="1" class="wares-input qty" onkeyup="this.value=this.value.replace(/\D/g,'')" data-min="1" data-max="2" data-key="<?php echo $info->goods_num;?>" onblur="javascript:goodsQtyChange($(this),<?php echo $info->limit_num;?>);"/>
                        <span class="add" unselectable="on" onclick="javascript:goodsQtyUpdate('up',$(this),<?php echo $info->limit_num;?>)">+</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="wares-alert flex">
            <?php if ($info->goods_num<=0):?>
                <a href="javascript:;" class="warning-tips am-text-truncate">库存不足</a>
            <?php elseif ( isset($bayNum) && $bayNum >= $info->limit_num ) : ?>
                <a href="javascript:;" class="warning-tips am-text-truncate"><?php echo $info->limit_day.'天内，限购'.$info->limit_num.'件';?></a>
            <?php else:?>
                <a href="javascript:" onclick="alert('预览页面无法购买')" >
                    加入购物车
                </a>
                <a href="javascript:" onclick="alert('预览页面无法购买')" >
                    立即购买
                </a>
            <?php endif;?>
        </div>
    </div>
<?php if (!empty($jump_url)): ?>
    <div class="ws-black-show">
        <div class="black-img">
            <a href="<?php echo isset($jump_url[$info->goods_attr_id]) ? $jump_url[$info->goods_attr_id] : '';?>">
                <img src="/skins/tourism/images/more-link.png">
            </a>
        </div>
    </div>
<?php endif ?>
<?php $this->load->view('tourism/layout/footer')?>